<%--
  Created by IntelliJ IDEA.
  User: ChenTianYu
  Date: 2023/12/22
  Time: 9:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>注册</title>
</head>
<style>
    *{
        margin: 0;
        padding: 0;
    }
</style>
<body>
    <form action="link-mysql" method="post" onsubmit="return fun()">
        <input type="text" placeholder="用户名" name="username"/><br />
        <input type="password" placeholder="密码" name="password" id="password"/><br />
        <input type="password" placeholder="确认密码" name="passwordTrue" id="passwordTrue"/><br />
        <input type="submit" value="注册" />
    </form>
</body>

<script type="text/javascript">
    const password = document.getElementById("password")
    const passwordTrue = document.getElementById("passwordTrue")

    function fun(){
        //俩个密码不相等
        if(password.value != passwordTrue.value){
            alert("密码不相同，请重新输入")
            return false
        }else{
            alert("提交成功")
            return true
        }
    }

</script>
</html>
